<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>IgH EtherCAT Master: EtherCAT Device Interface</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">IgH EtherCAT Master
   &#160;<span id="projectnumber">1.5.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__DeviceInterface.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">EtherCAT Device Interface</div>  </div>
</div><!--header-->
<div class="contents">

<p>Master interface for EtherCAT-capable network device drivers.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga3934f8a07aa394d558147d790fc60a8b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DeviceInterface.html#ga3934f8a07aa394d558147d790fc60a8b">ecdev_withdraw</a> (<a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *device)</td></tr>
<tr class="memdesc:ga3934f8a07aa394d558147d790fc60a8b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Withdraws an EtherCAT device from the master.  <a href="#ga3934f8a07aa394d558147d790fc60a8b">More...</a><br /></td></tr>
<tr class="separator:ga3934f8a07aa394d558147d790fc60a8b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga34eceaecfe6ab4fe8f0ecde1a3b311c4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DeviceInterface.html#ga34eceaecfe6ab4fe8f0ecde1a3b311c4">ecdev_open</a> (<a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *device)</td></tr>
<tr class="memdesc:ga34eceaecfe6ab4fe8f0ecde1a3b311c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Opens the network device and makes the master enter IDLE phase.  <a href="#ga34eceaecfe6ab4fe8f0ecde1a3b311c4">More...</a><br /></td></tr>
<tr class="separator:ga34eceaecfe6ab4fe8f0ecde1a3b311c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0a6b26b2397aa49cc82915a12b8cc854"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DeviceInterface.html#ga0a6b26b2397aa49cc82915a12b8cc854">ecdev_close</a> (<a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *device)</td></tr>
<tr class="memdesc:ga0a6b26b2397aa49cc82915a12b8cc854"><td class="mdescLeft">&#160;</td><td class="mdescRight">Makes the master leave IDLE phase and closes the network device.  <a href="#ga0a6b26b2397aa49cc82915a12b8cc854">More...</a><br /></td></tr>
<tr class="separator:ga0a6b26b2397aa49cc82915a12b8cc854"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf02497a3d6bb0e43dcefc1802f8666a5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DeviceInterface.html#gaf02497a3d6bb0e43dcefc1802f8666a5">ecdev_receive</a> (<a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *device, const void *data, size_t size)</td></tr>
<tr class="memdesc:gaf02497a3d6bb0e43dcefc1802f8666a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Accepts a received frame.  <a href="#gaf02497a3d6bb0e43dcefc1802f8666a5">More...</a><br /></td></tr>
<tr class="separator:gaf02497a3d6bb0e43dcefc1802f8666a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac1d0e31b8b60ad4e94c03148aac88499"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DeviceInterface.html#gac1d0e31b8b60ad4e94c03148aac88499">ecdev_set_link</a> (<a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *device, uint8_t state)</td></tr>
<tr class="memdesc:gac1d0e31b8b60ad4e94c03148aac88499"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a new link state.  <a href="#gac1d0e31b8b60ad4e94c03148aac88499">More...</a><br /></td></tr>
<tr class="separator:gac1d0e31b8b60ad4e94c03148aac88499"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa31bc8d955fea01e8430105c61064589"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DeviceInterface.html#gaa31bc8d955fea01e8430105c61064589">ecdev_get_link</a> (const <a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *device)</td></tr>
<tr class="memdesc:gaa31bc8d955fea01e8430105c61064589"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the link state.  <a href="#gaa31bc8d955fea01e8430105c61064589">More...</a><br /></td></tr>
<tr class="separator:gaa31bc8d955fea01e8430105c61064589"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga522b0264934a68d51cc5b67f2c76ef30"><td class="memItemLeft" align="right" valign="top"><a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DeviceInterface.html#ga522b0264934a68d51cc5b67f2c76ef30">ecdev_offer</a> (struct net_device *net_dev, <a class="el" href="ecdev_8h.html#a789bcd88d869f88c58bd13b451b3fd52">ec_pollfunc_t</a> poll, struct module *module)</td></tr>
<tr class="memdesc:ga522b0264934a68d51cc5b67f2c76ef30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Offers an EtherCAT device to a certain master.  <a href="#ga522b0264934a68d51cc5b67f2c76ef30">More...</a><br /></td></tr>
<tr class="separator:ga522b0264934a68d51cc5b67f2c76ef30"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Master interface for EtherCAT-capable network device drivers. </p>
<p>Through the EtherCAT device interface, EtherCAT-capable network device drivers are able to connect their device(s) to the master, pass received frames and notify the master about status changes. The master on his part, can send his frames through connected devices. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga3934f8a07aa394d558147d790fc60a8b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3934f8a07aa394d558147d790fc60a8b">&#9670;&nbsp;</a></span>ecdev_withdraw()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ecdev_withdraw </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Withdraws an EtherCAT device from the master. </p>
<p>The device is disconnected from the master and all device ressources are freed.</p>
<dl class="section attention"><dt>Attention</dt><dd>Before calling this function, the ecdev_stop() function has to be called, to be sure that the master does not use the device any more. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>EtherCAT device </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="device_8c_source.html#l00543">543</a> of file <a class="el" href="device_8c_source.html">device.c</a>.</p>

</div>
</div>
<a id="ga34eceaecfe6ab4fe8f0ecde1a3b311c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga34eceaecfe6ab4fe8f0ecde1a3b311c4">&#9670;&nbsp;</a></span>ecdev_open()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ecdev_open </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Opens the network device and makes the master enter IDLE phase. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, else &lt; 0 </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>EtherCAT device </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="device_8c_source.html#l00574">574</a> of file <a class="el" href="device_8c_source.html">device.c</a>.</p>

</div>
</div>
<a id="ga0a6b26b2397aa49cc82915a12b8cc854"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0a6b26b2397aa49cc82915a12b8cc854">&#9670;&nbsp;</a></span>ecdev_close()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ecdev_close </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Makes the master leave IDLE phase and closes the network device. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, else &lt; 0 </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>EtherCAT device </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="device_8c_source.html#l00612">612</a> of file <a class="el" href="device_8c_source.html">device.c</a>.</p>

</div>
</div>
<a id="gaf02497a3d6bb0e43dcefc1802f8666a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf02497a3d6bb0e43dcefc1802f8666a5">&#9670;&nbsp;</a></span>ecdev_receive()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ecdev_receive </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *&#160;</td>
          <td class="paramname"><em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Accepts a received frame. </p>
<p>Forwards the received data to the master. The master will analyze the frame and dispatch the received commands to the sending instances. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>EtherCAT device </td></tr>
    <tr><td class="paramname">data</td><td>pointer to received data </td></tr>
    <tr><td class="paramname">size</td><td>number of bytes received </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="device_8c_source.html#l00634">634</a> of file <a class="el" href="device_8c_source.html">device.c</a>.</p>

</div>
</div>
<a id="gac1d0e31b8b60ad4e94c03148aac88499"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac1d0e31b8b60ad4e94c03148aac88499">&#9670;&nbsp;</a></span>ecdev_set_link()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ecdev_set_link </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *&#160;</td>
          <td class="paramname"><em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>state</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets a new link state. </p>
<p>If the device notifies the master about the link being down, the master will not try to send frames using this device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>EtherCAT device </td></tr>
    <tr><td class="paramname">state</td><td>new link state </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="device_8c_source.html#l00678">678</a> of file <a class="el" href="device_8c_source.html">device.c</a>.</p>

</div>
</div>
<a id="gaa31bc8d955fea01e8430105c61064589"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa31bc8d955fea01e8430105c61064589">&#9670;&nbsp;</a></span>ecdev_get_link()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t ecdev_get_link </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads the link state. </p>
<dl class="section return"><dt>Returns</dt><dd>Link state. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>EtherCAT device </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="device_8c_source.html#l00704">704</a> of file <a class="el" href="device_8c_source.html">device.c</a>.</p>

</div>
</div>
<a id="ga522b0264934a68d51cc5b67f2c76ef30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga522b0264934a68d51cc5b67f2c76ef30">&#9670;&nbsp;</a></span>ecdev_offer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="ecdev_8h.html#ac0895793ea540357d225d4b8be71f2e4">ec_device_t</a>* ecdev_offer </td>
          <td>(</td>
          <td class="paramtype">struct net_device *&#160;</td>
          <td class="paramname"><em>net_dev</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="ecdev_8h.html#a789bcd88d869f88c58bd13b451b3fd52">ec_pollfunc_t</a>&#160;</td>
          <td class="paramname"><em>poll</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct module *&#160;</td>
          <td class="paramname"><em>module</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Offers an EtherCAT device to a certain master. </p>
<p>The master decides, if it wants to use the device for EtherCAT operation, or not. It is important, that the offered net_device is not used by the kernel IP stack. If the master, accepted the offer, the address of the newly created EtherCAT device is returned, else <em>NULL</em> is returned.</p>
<dl class="section return"><dt>Returns</dt><dd>Pointer to device, if accepted, or NULL if declined. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">net_dev</td><td>net_device to offer </td></tr>
    <tr><td class="paramname">poll</td><td>device poll function </td></tr>
    <tr><td class="paramname">module</td><td>pointer to the module </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="module_8c_source.html#l00473">473</a> of file <a class="el" href="module_8c_source.html">module.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
